/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

/**
 *
 * @author "Jeroen"
 */
public class Square {

    private boolean bomb = false;
    private int nearby_bombs = 0;
    private boolean flagged = false;
    private boolean visible = false;

    public boolean isBomb() {
        return bomb;
    }

    public void setBomb(boolean bomb) {
        this.bomb = bomb;
    }

    public int getNearby_bombs() {
        return nearby_bombs;
    }

    public void addNearby_bomb() {
        this.nearby_bombs++;
    }

    public void setNearby_bombs(int nearby_bombs) {
        this.nearby_bombs = nearby_bombs;
    }

    public char toChar() {
        if (visible) {
            if (bomb) {
                return 'X';
            } else {
                return ((Integer) nearby_bombs).toString().charAt(0);
            }
        } else if (flagged) {
            return '!';
        } else {
            return 'O';
        }
    }
}
